// Import SASS modules
@use "sass:map";

// SCSS Variables
$colors: (
  primary: #2563eb,
  primary-dark: #1d4ed8,
  primary-light: #3b82f6,
  secondary: #e5e7eb,
  secondary-dark: #d1d5db,
  gray-50: #f9fafb,
  gray-100: #f3f4f6,
  gray-200: #e5e7eb,
  gray-300: #d1d5db,
  gray-400: #9ca3af,
  gray-500: #6b7280,
  gray-600: #4b5563,
  gray-700: #374151,
  gray-800: #1f2937,
  gray-900: #111827,
  white: #ffffff,
  black: #000000
);

$spacing: (
  0: 0,
  1: 0.25rem,
  2: 0.5rem,
  3: 0.75rem,
  4: 1rem,
  5: 1.25rem,
  6: 1.5rem,
  8: 2rem,
  10: 2.5rem,
  12: 3rem,
  16: 4rem,
  20: 5rem,
  24: 6rem,
  32: 8rem,
  40: 10rem,
  48: 12rem,
  56: 14rem,
  64: 16rem
);

$breakpoints: (
  sm: 640px,
  md: 768px,
  lg: 1024px,
  xl: 1280px,
  2xl: 1536px
);

$border-radius: (
  none: 0,
  sm: 0.125rem,
  "default": 0.25rem,
  md: 0.375rem,
  lg: 0.5rem,
  xl: 0.75rem,
  2xl: 1rem,
  3xl: 1.5rem,
  full: 9999px
);

$shadows: (
  sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05),
  "default": (0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)),
  md: (0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)),
  lg: (0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)),
  xl: (0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)),
  2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
  none: none
);

// Mixins
@mixin respond-to($breakpoint) {
  @if map.has-key($breakpoints, $breakpoint) {
    @media (min-width: map.get($breakpoints, $breakpoint)) {
      @content;
    }
  }
}

@mixin button-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: map.get($border-radius, lg);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  border: none;
  text-decoration: none;

  &:focus {
    outline: none;
    box-shadow: 0 0 0 2px map.get($colors, primary-light), 0 0 0 4px rgba(59, 130, 246, 0.5);
  }
}

@mixin card {
  background-color: map.get($colors, white);
  border-radius: map.get($border-radius, xl);
  box-shadow: map.get($shadows, lg);
  overflow: hidden;
}

// CSS Reset
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

// 全局隐藏滚动条
* {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */

  &::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
  }
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;

  // 隐藏滚动条但保持滚动功能
  overflow-x: hidden;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */

  &::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
  }
}

body {
  font-family: 'Microsoft YaHei', 'Inter', 'Noto Sans SC', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  color: map.get($colors, gray-900);
  background-color: map.get($colors, white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  // 隐藏滚动条
  overflow-x: hidden;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */

  &::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: map.get($spacing, 4);
  letter-spacing: -0.025em;
}

p {
  margin-bottom: map.get($spacing, 4);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.15s ease-in-out;
}

input,
textarea,
select {
  font-family: inherit;
  transition: color 0.15s ease-in-out;
}

// Focus styles
:focus-visible {
  outline: 2px solid map.get($colors, primary);
  outline-offset: 2px;
}

// Screen reader only
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

// 自定义滚动条样式（可选使用）
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: map.get($colors, gray-400) transparent;

  &::-webkit-scrollbar {
    display: block;
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: map.get($colors, gray-400);
    border-radius: 3px;
    transition: background-color 0.3s ease;

    &:hover {
      background-color: map.get($colors, gray-600);
    }
  }
}

// Button Components
.btn {
  @include button-base;
  padding: map.get($spacing, 3) map.get($spacing, 6);

  &.btn-primary {
    background-color: map.get($colors, primary);
    color: map.get($colors, white);

    &:hover {
      background-color: map.get($colors, primary-dark);
    }
  }

  &.btn-secondary {
    background-color: map.get($colors, secondary);
    color: map.get($colors, gray-900);

    &:hover {
      background-color: map.get($colors, secondary-dark);
    }
  }

  &.btn-outline {
    border: 2px solid map.get($colors, primary);
    color: map.get($colors, primary);
    background-color: transparent;

    &:hover {
      background-color: map.get($colors, primary);
      color: map.get($colors, white);
    }
  }
}

// Card Component
.card {
  @include card;
}

// Form Components
.form {
  &-input {
    display: block;
    width: 100%;
    padding: map.get($spacing, 3) map.get($spacing, 4);
    border: 1px solid map.get($colors, gray-300);
    border-radius: map.get($border-radius, lg);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

    &:focus {
      outline: none;
      border-color: map.get($colors, primary-light);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
    }
  }

  &-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: map.get($colors, gray-700);
    margin-bottom: map.get($spacing, 2);
  }
}

// Layout Components
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 map.get($spacing, 4);

  @include respond-to(sm) {
    padding: 0 map.get($spacing, 6);
  }

  @include respond-to(lg) {
    padding: 0 map.get($spacing, 8);
  }
}

.section {
  padding: map.get($spacing, 20) 0;

  @include respond-to(lg) {
    padding: map.get($spacing, 24) 0;
  }

  @include respond-to(sm) {
    padding: map.get($spacing, 12) 0;
  }
}

// Utility Classes
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

// Animations
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-in-out;
}

.animate-slide-down {
  animation: slideDown 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

// Dark mode support
@media (prefers-color-scheme: dark) {
  .dark {
    background-color: map.get($colors, gray-900);
    color: map.get($colors, white);
  }
}

// Print styles
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}



.n-btn {
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  line-height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  padding: 0 26px;
  cursor: pointer;

  .icon {
    width: 32px;
    height: 32px;
  }

  &.btn-light {
    background: #F2F8FE;
    border: 1px solid #0975EE;
    color: #0975EE;

    &:hover {
      background: linear-gradient(90deg, #0975EE 0%, #4DA1FF 100%);
      border: none;
      color: #FFFFFF;
      transform: translateY(-3px);
    }
  }

   &.btn-blue {
    color: #FFFFFF;
    background-image: linear-gradient(to right, #0975EE 0%, #4DA1FF 50%, #0975EE 100%);
    background-size: 200% auto;
    &:hover {
        background-position: right center;
        transform: translateY(-3px);
      }
    }
}